package com.ts.api.http.platform.biz;

import com.alibaba.fastjson.JSONObject;
import com.gitee.apanlh.util.algorithm.encrypt.symmetric.AES;
import com.gitee.apanlh.util.base.ChooseEq;
import com.gitee.apanlh.util.base.CollUtils;
import com.gitee.apanlh.util.base.Eq;
import com.gitee.apanlh.util.base.MapUtils;
import com.gitee.apanlh.util.dataformat.JsonUtils;
import com.gitee.apanlh.util.valid.ValidParam;
import com.gitee.apanlh.web.model.vo.RequestVO;
import com.ts.api.common.util.H5DomainUrlUtils;
import com.ts.api.http.platform.entity.apply.ApiPlatApplyRuYiHuaData;
import com.ts.api.http.platform.entity.dataexchange.ApiPlatDataExchangeRuYiHuaData;
import com.ts.api.module.api.convert.core.annotation.ApiPlan;
import com.ts.api.module.api.convert.core.annotation.ApiPlanConvertType;
import com.ts.api.module.api.convert.core.entity.ApiApplyParameter;
import com.ts.api.module.api.convert.core.entity.ApiBizStatus;
import com.ts.api.module.api.convert.core.entity.ApiDataExchangeParameter;
import com.ts.api.module.api.convert.core.utils.ApiFieldConverter;
import com.ts.api.module.api.convert.platform.entity.*;
import com.ts.api.module.api.convert.platform.handler.ApiPlatformPhoneMaskConvertHandler;
import com.ts.api.module.api.entity.ApiProtocol;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
 * 如意花
 * 采量半流程V2  https://doc.apipost.net/docs/491bc56b70b5000?locale=zh-cn
 *
 * @author WJB
 */
@ApiPlan(productId = "333", type = ApiPlanConvertType.PLAT_PHONE_MASK)
public class ApiPlatRuYiHua implements ApiPlatformPhoneMaskConvertHandler {

    private static String KEY = "458eae033b084fee";
    private static String CHANNEL_CODE = "uMfiMAt7";

    @Override
    public Object dataExchange(ApiDataExchangeParameter apiDataExchangeParameter) {
        ApiPlatDataExchangeRuYiHuaData apiPlatDataExchangeRuYiHuaData = new ApiPlatDataExchangeRuYiHuaData();
        apiPlatDataExchangeRuYiHuaData.setPhonePre(apiDataExchangeParameter.getPhoneMask());
        apiPlatDataExchangeRuYiHuaData.setRealName("默认姓名");
        if (ValidParam.isNotEmpty(apiDataExchangeParameter.getAge())){
            apiPlatDataExchangeRuYiHuaData.setAge(Integer.valueOf(apiDataExchangeParameter.getAge()));
        }else {
            apiPlatDataExchangeRuYiHuaData.setAge(18);
        }
        // 市级名称
        apiPlatDataExchangeRuYiHuaData.setWorkCity(apiDataExchangeParameter.getCity());
        // 市级编码
        apiPlatDataExchangeRuYiHuaData.setCityCode(apiDataExchangeParameter.getAreaCode());
        // ip地址
        if (ValidParam.isEmpty(apiDataExchangeParameter.getIp())){
            apiPlatDataExchangeRuYiHuaData.setIp("127.0.0.1");
        }else {
            apiPlatDataExchangeRuYiHuaData.setIp(apiDataExchangeParameter.getIp());
        }
        // 用户客户端 1-Android 2-IOS 默认1
        apiPlatDataExchangeRuYiHuaData.setClient(1);
        //  拓展信息
        ApiFieldConverter apiFieldConverter = ApiFieldConverter.create(apiDataExchangeParameter);
        // sex 性别 1:男 2:女
        String sex = apiDataExchangeParameter.getSex();
        Integer sexChoose = ChooseEq.create()
                .when(sex, "0", 1)
                .when(sex, "1", 2)
                .end(1);
        apiPlatDataExchangeRuYiHuaData.setGender(sexChoose);

        // accumulationFund 公积金:0-无公积金 1-有公积金 默认0
        String providentFund = apiDataExchangeParameter.getProvidentFund();
        Integer fund = ChooseEq.create()
                .when(providentFund, "1", 0)
                .when(providentFund, "2", 1)
                .when(providentFund, "3", 1)
                .when(providentFund, "4", 1)
                .end(0);
        apiPlatDataExchangeRuYiHuaData.setAccumulationFund(fund);

        // socialSecurity 社保：
        String socialSecurity = apiDataExchangeParameter.getSocialSecurity();
        Integer social = ChooseEq.create()
                .when(socialSecurity, "1", 0)
                .when(socialSecurity, "2", 1)
                .when(socialSecurity, "3", 1)
                .when(socialSecurity, "4", 1)
                .end(0);
        apiPlatDataExchangeRuYiHuaData.setSocialSecurity(social);

        // house 房产：
        String realEstateInfo = apiDataExchangeParameter.getRealEstateInfo();
        Integer house = ChooseEq.create()
                .when(realEstateInfo, "1", 0)
                .when(realEstateInfo, "2", 1)
                .when(realEstateInfo, "3", 1)
                .when(realEstateInfo, "4", 1)
                .when(realEstateInfo, "5", 1)
                .when(realEstateInfo, "6", 1)
                .end(0);
        apiPlatDataExchangeRuYiHuaData.setHouse(house);

        // vehicle  车产：
        String carInfo = apiDataExchangeParameter.getCarInfo();
        Integer car = ChooseEq.create()
                .when(carInfo, "1", 0)
                .when(carInfo, "2", 1)
                .when(carInfo, "3", 1)
                .when(carInfo, "4", 1)
            .end(0);
        apiPlatDataExchangeRuYiHuaData.setVehicle(car);

        // insurance 保单 0-无保单 1-有保单 默认0
        String insurancePolicy = apiDataExchangeParameter.getInsurancePolicy();
        Integer policy = ChooseEq.create()
                .when(insurancePolicy, "1", 0)
                .when(insurancePolicy, "2", 1)
                .when(insurancePolicy, "3", 1)
                .when(insurancePolicy, "4", 1)
            .end(0);
        apiPlatDataExchangeRuYiHuaData.setInsurance(policy);

        // sesameScore 芝麻分:
        String sesameCredit = apiDataExchangeParameter.getSesameCredit();
        Integer zhima = ChooseEq.create()
                .when(sesameCredit, "1", 1)
                .when(sesameCredit, "2", 2)
                .when(sesameCredit, "3", 3)
                .when(sesameCredit, "4", 4)
                .end(1);
        apiPlatDataExchangeRuYiHuaData.setSesameScore(zhima);

        // professional 职业身份 1-上班族 2-公务员/事业单位 3-私营业主 4-个体户 5-其他 默认1
        String career = apiDataExchangeParameter.getCareer();
        Integer professional = ChooseEq.create()
                .when(career, "1", 1)
                .when(career, "2", 5)
                .when(career, "3", 3)
                .when(career, "4", 2)
                .when(career, "5", 4)
                .end(1);
        apiPlatDataExchangeRuYiHuaData.setProfessional(professional);

        // amount 借款金额 10000-1000000(单位元,以10000递增) 默认50000
        if (ValidParam.isNotEmpty(apiDataExchangeParameter.getLoanAmount())) {
            apiPlatDataExchangeRuYiHuaData.setAmount(apiFieldConverter.getLoanAmountInt());
        }else {
            apiPlatDataExchangeRuYiHuaData.setAmount(50000);
        }

        // loanTerm 借款期限
        apiPlatDataExchangeRuYiHuaData.setLoanTerm(1);

        // loanUse 借款用途 1-购房 2-购车 3-住房装修 4-教育深造 5-休闲旅游 6-个人消费 7-房租缴纳 8-其他贷款 默认6
        String loanUse = apiDataExchangeParameter.getLoanPurpose();
        Integer purpose = ChooseEq.create()
                .when(loanUse, "1", 5)
                .when(loanUse, "2", 4)
                .when(loanUse, "3", 6)
                .when(loanUse, "4", 3)
                .when(loanUse, "5", 6)
                .when(loanUse, "6", 6)
                .end(6);
        apiPlatDataExchangeRuYiHuaData.setLoanUse(purpose);

        // creditCard 信用卡: 0:无信用卡 1:1-5万 2:5-10万 3:10-20万 4:20万以上 默认0
        String creditCard = apiDataExchangeParameter.getCreditLimit();
        Integer credit = ChooseEq.create()
                .when(creditCard, "1", 0)
                .when(creditCard, "2", 1)
                .when(creditCard, "3", 1)
                .when(creditCard, "4", 1)
                .when(creditCard, "5", 2)
                .when(creditCard, "6", 1)
                .end(0);
        apiPlatDataExchangeRuYiHuaData.setCreditCard(credit);

        //  花呗 0:无花呗 1:1-5万 2:5-10万 3:10-20万 4:20万以上 默认0
        String HuaBei = apiDataExchangeParameter.getHbLimit();
        Integer hbLimit = ChooseEq.create()
                .when(HuaBei, "1", 0)
                .when(HuaBei, "2", 1)
                .when(HuaBei, "3", 1)
                .when(HuaBei, "4", 1)
                .when(HuaBei, "5", 2)
                .end(0);
        apiPlatDataExchangeRuYiHuaData.setHuabei(hbLimit);

        //  白条 0:无白条 1:1-5万 2:5-10万 3:10-20万 4:20万以上 默认0
        String BaiTiao = apiDataExchangeParameter.getBtLimit();
        Integer btLimit = ChooseEq.create()
                .when(BaiTiao, "1", 0)
                .when(BaiTiao, "2", 1)
                .when(BaiTiao, "3", 1)
                .when(BaiTiao, "4", 1)
                .when(BaiTiao, "5", 2)
                .end(0);
        apiPlatDataExchangeRuYiHuaData.setBaitiao(btLimit);

        // monthIncome 月收入 1:5000以下 2:5000-1万 3:1万-1.5万 4:1.5万-2万 5:2万以上 默认2
        String monthIncome = apiDataExchangeParameter.getMonthlySalary();
        Integer income = ChooseEq.create()
                .when(monthIncome, "1", 1)
                .when(monthIncome, "2", 2)
                .when(monthIncome, "3", 3)
                .when(monthIncome, "4", 4)
                .when(monthIncome, "5", 5)
                .end(2);
        apiPlatDataExchangeRuYiHuaData.setMonthIncome(income);

        // salaryType 工资发放形式 1-银行代发 2-转账工资 3-现金发放 默认1:
        String salaryType = apiDataExchangeParameter.getSalaryPayMethod();
        Integer payType = ChooseEq.create()
                .when(salaryType, "1", 1)
                .when(salaryType, "2", 3)
                .when(salaryType, "3", 2)
                .end(1);
        apiPlatDataExchangeRuYiHuaData.setSalaryType(payType);

        // education 学历 1:大专以下 2:大专 3:本科 4:研究生 5:博士 默认2
        String education = apiDataExchangeParameter.getEducationAttainment();
        Integer educationAttainment = ChooseEq.create()
                .when(education, "1", 1)
                .when(education, "2", 1)
                .when(education, "3", 1)
                .when(education, "4", 2)
                .when(education, "5", 3)
                .when(education, "6", 4)
                .end(2);
        apiPlatDataExchangeRuYiHuaData.setEducation(educationAttainment);

        // 获取当前时间
        LocalDateTime now = LocalDateTime.now();
        // 定义时间格式
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        // 格式化当前时间
        String formattedTime = now.format(formatter);
        // AES 加密
        AES aes = AES.createEcb(KEY.getBytes());
        String jsonStr = JsonUtils.toJson(apiPlatDataExchangeRuYiHuaData);
        String dataStr = aes.encryptToBase64Str(jsonStr);

        Map<String, Object> map = MapUtils.<String, Object>newHashMap(newMap -> {
            newMap.put("channelCode", CHANNEL_CODE);
            newMap.put("requestId", apiDataExchangeParameter.getReqId());
            newMap.put("content", dataStr);
            newMap.put("requestTime", formattedTime);
        });
        String json = JsonUtils.toJson(map);
        return json;
    }

    @Override
    public String apply(ApiApplyParameter apiApplyParameter) {
        ApiPlatApplyRuYiHuaData apiPlatApplyRuYiHuaData = new ApiPlatApplyRuYiHuaData();
        apiPlatApplyRuYiHuaData.setApplyNo(apiApplyParameter.getApplyId());
        apiPlatApplyRuYiHuaData.setMobile(apiApplyParameter.getPhone());
        apiPlatApplyRuYiHuaData.setRealName(apiApplyParameter.getUserName());
        if (ValidParam.isNotEmpty(apiApplyParameter.getAge())){
            apiPlatApplyRuYiHuaData.setAge(Integer.valueOf(apiApplyParameter.getAge()));
        }else {
            apiPlatApplyRuYiHuaData.setAge(18);
        }
        // 市级名称
        apiPlatApplyRuYiHuaData.setWorkCity(apiApplyParameter.getCity());
        // 市级编码
        apiPlatApplyRuYiHuaData.setCityCode(apiApplyParameter.getAreaCode());
        // ip地址
        if (ValidParam.isEmpty(apiApplyParameter.getIp())){
            apiPlatApplyRuYiHuaData.setIp("127.0.0.1");
        }else {
            apiPlatApplyRuYiHuaData.setIp(apiApplyParameter.getIp());
        }

        // 用户客户端 1-Android 2-IOS 默认1
        apiPlatApplyRuYiHuaData.setClient(1);
        //  拓展信息
        ApiFieldConverter apiFieldConverter = ApiFieldConverter.create(apiApplyParameter);
        // sex 性别 1:男 2:女
        String sex = apiApplyParameter.getSex();
        Integer sexChoose = ChooseEq.create()
                .when(sex, "0", 1)
                .when(sex, "1", 2)
                .end(1);
        apiPlatApplyRuYiHuaData.setGender(sexChoose);

        // accumulationFund 公积金:0-无公积金 1-有公积金 默认0
        String providentFund = apiApplyParameter.getProvidentFund();
        Integer accumulationFund = ChooseEq.create()
                .when(providentFund, "1", 0)
                .when(providentFund, "2", 1)
                .when(providentFund, "3", 1)
                .when(providentFund, "4", 1)
                .end(0);
        apiPlatApplyRuYiHuaData.setAccumulationFund(accumulationFund);

        // socialSecurity 社保：
        String socialSecurity = apiApplyParameter.getSocialSecurity();
        Integer social = ChooseEq.create()
                .when(socialSecurity, "1", 0)
                .when(socialSecurity, "2", 1)
                .when(socialSecurity, "3", 1)
                .when(socialSecurity, "4", 1)
                .end(0);
        apiPlatApplyRuYiHuaData.setSocialSecurity(social);

        // house 房产：
        String realEstateInfo = apiApplyParameter.getRealEstateInfo();
        Integer house = ChooseEq.create()
                .when(realEstateInfo, "1", 0)
                .when(realEstateInfo, "2", 1)
                .when(realEstateInfo, "3", 1)
                .when(realEstateInfo, "4", 1)
                .when(realEstateInfo, "5", 1)
                .when(realEstateInfo, "6", 1)
                .end(0);
        apiPlatApplyRuYiHuaData.setHouse(house);

        // vehicle  车产：
        String carInfo = apiApplyParameter.getCarInfo();
        Integer vehicle = ChooseEq.create()
                .when(carInfo, "1", 0)
                .when(carInfo, "2", 1)
                .when(carInfo, "3", 1)
                .when(carInfo, "4", 1)
                .end(0);
        apiPlatApplyRuYiHuaData.setVehicle(vehicle);

        // insurance 保单 0-无保单 1-有保单 默认0
        String insurancePolicy = apiApplyParameter.getInsurancePolicy();
        Integer insurance = ChooseEq.create()
                .when(insurancePolicy, "1", 0)
                .when(insurancePolicy, "2", 1)
                .when(insurancePolicy, "3", 1)
                .when(insurancePolicy, "4", 1)
                .end(0);
        apiPlatApplyRuYiHuaData.setInsurance(insurance);

        // sesameScore 芝麻分:
        String sesameCredit = apiApplyParameter.getSesameCredit();
        Integer sesameScore = ChooseEq.create()
                .when(sesameCredit, "1", 1)
                .when(sesameCredit, "2", 2)
                .when(sesameCredit, "3", 3)
                .when(sesameCredit, "4", 4)
                .end(1);
        apiPlatApplyRuYiHuaData.setSesameScore(sesameScore);

        // professional 职业身份 1-上班族 2-公务员/事业单位 3-私营业主 4-个体户 5-其他 默认1
        String career = apiApplyParameter.getCareer();
        Integer professional = ChooseEq.create()
                .when(career, "1", 1)
                .when(career, "2", 5)
                .when(career, "3", 3)
                .when(career, "4", 2)
                .when(career, "5", 4)
                .end(1);
        apiPlatApplyRuYiHuaData.setProfessional(professional);

        // amount 借款金额 10000-1000000(单位元,以10000递增) 默认50000
        if (ValidParam.isNotEmpty(apiApplyParameter.getLoanAmount())) {
            apiPlatApplyRuYiHuaData.setAmount(apiFieldConverter.getLoanAmountInt());
        }else {
            apiPlatApplyRuYiHuaData.setAmount(50000);
        }

        // loanTerm 借款期限
        apiPlatApplyRuYiHuaData.setLoanTerm(1);

        // loanUse 借款用途 1-购房 2-购车 3-住房装修 4-教育深造 5-休闲旅游 6-个人消费 7-房租缴纳 8-其他贷款 默认6
        String loanUse = apiApplyParameter.getLoanPurpose();
        Integer purpose = ChooseEq.create()
                .when(loanUse, "1", 5)
                .when(loanUse, "2", 4)
                .when(loanUse, "3", 6)
                .when(loanUse, "4", 3)
                .when(loanUse, "5", 6)
                .when(loanUse, "6", 6)
                .end(6);
        apiPlatApplyRuYiHuaData.setLoanUse(purpose);

        // creditCard 信用卡: 0:无信用卡 1:1-5万 2:5-10万 3:10-20万 4:20万以上 默认0
        String creditCard = apiApplyParameter.getCreditLimit();
        Integer creditLimit = ChooseEq.create()
                .when(creditCard, "1", 0)
                .when(creditCard, "2", 1)
                .when(creditCard, "3", 1)
                .when(creditCard, "4", 1)
                .when(creditCard, "5", 2)
                .when(creditCard, "6", 1)
                .end(0);
        apiPlatApplyRuYiHuaData.setCreditCard(creditLimit);

        //  花呗 0:无花呗 1:1-5万 2:5-10万 3:10-20万 4:20万以上 默认0
        String HuaBei = apiApplyParameter.getHbLimit();
        Integer hbLimit = ChooseEq.create()
                .when(HuaBei, "1", 0)
                .when(HuaBei, "2", 1)
                .when(HuaBei, "3", 1)
                .when(HuaBei, "4", 1)
                .when(HuaBei, "5", 2)
                .end(0);
        apiPlatApplyRuYiHuaData.setHuabei(hbLimit);

        //  白条 0:无白条 1:1-5万 2:5-10万 3:10-20万 4:20万以上 默认0
        String BaiTiao = apiApplyParameter.getBtLimit();
        Integer btLimit = ChooseEq.create()
                .when(BaiTiao, "1", 0)
                .when(BaiTiao, "2", 1)
                .when(BaiTiao, "3", 1)
                .when(BaiTiao, "4", 1)
                .when(BaiTiao, "5", 2)
                .end(0);
        apiPlatApplyRuYiHuaData.setBaitiao(btLimit);

        // monthIncome 月收入 1:5000以下 2:5000-1万 3:1万-1.5万 4:1.5万-2万 5:2万以上 默认2
        String monthIncome = apiApplyParameter.getMonthlySalary();
        Integer income = ChooseEq.create()
                .when(monthIncome, "1", 1)
                .when(monthIncome, "2", 2)
                .when(monthIncome, "3", 3)
                .when(monthIncome, "4", 4)
                .when(monthIncome, "5", 5)
                .end(2);
        apiPlatApplyRuYiHuaData.setMonthIncome(income);

        // salaryType 工资发放形式 1-银行代发 2-转账工资 3-现金发放 默认1:
        String salaryType = apiApplyParameter.getSalaryPayMethod();
        Integer payType = ChooseEq.create()
                .when(salaryType, "1", 1)
                .when(salaryType, "2", 3)
                .when(salaryType, "3", 2)
                .end(1);
        apiPlatApplyRuYiHuaData.setSalaryType(payType);

        // education 学历 1:大专以下 2:大专 3:本科 4:研究生 5:博士 默认2
        String education = apiApplyParameter.getEducationAttainment();
        Integer educationAttainment = ChooseEq.create()
                .when(education, "1", 1)
                .when(education, "2", 1)
                .when(education, "3", 1)
                .when(education, "4", 2)
                .when(education, "5", 3)
                .when(education, "6", 4)
                .end(2);
        apiPlatApplyRuYiHuaData.setEducation(educationAttainment);
        // 协议
        ApiPlatApplyRuYiHuaData.protocolList protocolList = new ApiPlatApplyRuYiHuaData.protocolList();
        protocolList.setProtocolName("个人信息授权协议");
        protocolList.setProtocolUrl(H5DomainUrlUtils.createUserProtocolUrl(apiApplyParameter.getProductPlanId(), apiApplyParameter.getPhoneMd5()));
        List<ApiPlatApplyRuYiHuaData.protocolList> list = new ArrayList<>();
        list.add(protocolList);
        apiPlatApplyRuYiHuaData.setProtocolList(list);

        // 获取当前时间
        LocalDateTime now = LocalDateTime.now();
        // 定义时间格式
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        // 格式化当前时间
        String formattedTime = now.format(formatter);
        // AES/ECB 加密
        AES aes = AES.createEcb(KEY.getBytes());
        String jsonStr = JsonUtils.toJson(apiPlatApplyRuYiHuaData);
        String dataStr = aes.encryptToBase64Str(jsonStr);

        Map<String, Object> map = MapUtils.<String, Object>newHashMap(newMap -> {
            newMap.put("channelCode", CHANNEL_CODE);
            newMap.put("requestId", apiApplyParameter.getReqId());
            newMap.put("content", dataStr);
            newMap.put("requestTime", formattedTime);
        });
        String json = JsonUtils.toJson(map);
        return json;
    }

    @Override
    public RespPlatformPhoneMaskApply respApply(String respJson) {
        JSONObject jsonObject = JsonUtils.get(respJson);
        if (jsonObject == null) {
            return RespPlatformPhoneMaskApply.ofFail();
        }
        if (!Eq.object(jsonObject.getInteger("code"), 200)) {
            return RespPlatformPhoneMaskApply.ofFail();
        }
        return RespPlatformPhoneMaskApply.ofSuc();
    }

    @Override
    public RespPlatformNoticeApply parseApplyNotice(RequestVO requestVO) {
        return null;
    }

    @Override
    public Map<String, Object> respApplyNotice(ApiBizStatus apiBizStatus) {
        return Map.of();
    }

    @Override
    public RespPlatformMultiPhoneMaskDataExchange respDataExchange(String respJson) {
        JSONObject Object = JsonUtils.get(respJson);
        if (Object == null) {
            return RespPlatformMultiPhoneMaskDataExchange.ofFail();
        }
        if (!Eq.object(Object.getInteger("code"),200)) {
            return RespPlatformMultiPhoneMaskDataExchange.ofFail();
        }

        JSONObject resData = JsonUtils.get(respJson).getJSONObject("data");
        if (resData == null) {
            return RespPlatformMultiPhoneMaskDataExchange.ofFail();
        }
        JSONObject resProtocolList = resData.getJSONObject("protocolList");

        BigDecimal price = resData.getBigDecimal("price");
        String companyName = resData.getString("companyName");
        String logo = resData.getString("logo");
        String productName = resData.getString("productName");
        String applyNo = resData.getString("applyNo");
        List<ApiProtocol> protocolList = CollUtils.newArrayList(newList -> {
            if (ValidParam.isNotEmpty(resProtocolList)) {
                ApiProtocol protocol = new ApiProtocol();
                protocol.setProtocolName(resProtocolList.getString("protocolName"));
                protocol.setProtocolUrl(resProtocolList.getString("protocolUrl"));
                newList.add(protocol);
            }
        });
        RespPlatformMultiPhoneMaskDataExchange respPlatformMultiPhoneMaskDataExchange = RespPlatformMultiPhoneMaskDataExchange.ofSuc();
        List<RespPlatformPhoneMaskDataExchange> listRespPlatformPhoneMaskDataExchange = CollUtils.newArrayList();

        RespPlatformPhoneMaskDataExchange result = RespPlatformPhoneMaskDataExchange.of();
        result.setPrice(price);
        result.setLogoPath(logo);
        result.setDisplayName(companyName);
        result.setProductName(productName);
        result.setProtocolList(protocolList);
        result.setApplyId(applyNo);
        listRespPlatformPhoneMaskDataExchange.add(result);
        respPlatformMultiPhoneMaskDataExchange.setListPhoneMask(listRespPlatformPhoneMaskDataExchange);
        return respPlatformMultiPhoneMaskDataExchange;
    }

}
